package com.pan.demo.anno;


import com.pan.demo.entity.Animal;
import com.pan.framework.anno.aop.MyAfter;
import com.pan.framework.anno.aop.MyAspect;
import com.pan.framework.anno.aop.MyBefore;
import com.pan.framework.core.aop.entiy.MyCutArgs;
import com.pan.framework.core.aop.entiy.MyCutParam;

@MyAspect(name="demoAspect")
public class DemoAspect {


    @MyAfter(execution = "demoService@queryOneAnimal();")
    public void cutResetAnimal(MyCutArgs myCutArgs){

        System.out.println("这这是我的后置切面");
        MyCutParam param = myCutArgs.getParamByOrder(0);
//        System.out.println(this+": "+param.getArg().toString());
        param.setArg(new Animal("野兽",24));
    }
    @MyBefore(execution = "demoService@queryOneAnimal();")
    public void methodBefore(){
        System.out.println("这这是我的前置切面");


    }
}
